#include<stdio.h>
int arrSum(int* arr, int start, int end){
	int b, res = 0;
	for(b = start; b < start + end; b++)
	{
		res += arr[b];
	}
	
	return res;
}
int sumOddLengthSubarrays(int* arr, int arrSize){
    int b = 0;
    int d = 0;
    int k = 0;
    int ans = 0;

    for(b = 1; b <= arrSize; b += 2){
        for(d = 0; d < b; d += b){
            for(k = d; k < arrSize - b + 1;k++){
                ans += arrSum(arr, k ,b);
            }
        }
    }
    return ans;
}